/* ===================================
   ULTRACOMP CATEGORIES REDESIGN
   Modern gaming aesthetic with purple theme
   =================================== */

/* Import Orbitron font for titles */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');

/* Reset and base container - Transparent wrapper */
.box-categories {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-top: 30px !important;
    margin-bottom: 30px !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    position: relative !important;
    overflow: visible !important;
    transition: none !important;
}

/* Remove gradient border since container is transparent */
.box-categories::before {
    display: none !important;
}

/* Remove hover effect */
.box-categories:hover {
    transform: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Ensure content is visible */
.box-categories > * {
    position: relative;
    z-index: 1;
}

/* Category title container - Full card with gradient border */
.box-categories h4 {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 24px !important;
    margin: 0 !important;
    backdrop-filter: blur(20px) !important;
    position: relative !important;
    overflow: hidden !important;
    border-bottom: 1px solid rgba(137, 44, 255, 0.3) !important;
    pointer-events: none !important;
    
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-family: 'Orbitron', monospace !important;
}

/* Gradient top border for title */
.box-categories h4::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #892CFF, #A459FF, #FF6B9D) !important;
    z-index: 1 !important;
}

/* Main category wrapper */
#categories {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: none !important;
    border-radius: 0 0 16px 16px !important;
    backdrop-filter: blur(20px) !important;
    overflow: hidden !important;
}

#categories .categories:last-child {
    margin-bottom: 0 !important;
}

#categories .categories:first-child {
    border-top: none !important;
}

/* Individual category block - Connected inside main container */
.categories {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    overflow: visible !important;
    transition: all 0.3s ease !important;
    backdrop-filter: none !important;
    position: relative !important;
    margin-bottom: 0 !important;
}

.categories:last-child {
    border-bottom: none !important;
}

.categories:hover {
    background: rgba(137, 44, 255, 0.05) !important;
}

.categories > * {
    position: relative !important;
    z-index: 2 !important;
}

/* Topic/main category link */
.categories .topic {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

.categories .topic a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 24px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 1.65rem !important;
    line-height: 1.2 !important;
    transition: all 0.3s ease !important;
    background: linear-gradient(90deg, transparent, rgba(137, 44, 255, 0.1), transparent) !important;
    background-size: 200% 100% !important;
    background-position: -100% 0 !important;
}

.categories .topic a:hover {
    background-position: 0 0 !important;
    color: #892CFF !important;
}

/* Active state for main category - WHITE TEXT ON PURPLE BACKGROUND */
.categories.active .topic a,
.categories .topic.active a {
    background: linear-gradient(135deg, rgba(137, 44, 255, 0.25), rgba(137, 44, 255, 0.15)) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-left: 5px solid #892CFF !important;
    box-shadow: 0 0 20px rgba(137, 44, 255, 0.4), inset 0 0 20px rgba(137, 44, 255, 0.1) !important;
    line-height: 1.2 !important;
}

/* Category trigger arrow */
.categories .topic .cat-trigger {
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
    position: relative !important;
    transition: transform 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    vertical-align: middle !important;
    margin: 0 !important;
    padding: 0 !important;
}

.categories .topic .cat-trigger::before {
    content: '' !important;
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    border-right: 2px solid currentColor !important;
    border-bottom: 2px solid currentColor !important;
    transform: rotate(45deg) !important;
    margin: 0 !important;
}

.categories.expanded .topic .cat-trigger::before {
    transform: rotate(-135deg) !important;
}

/* Ensure active category arrow stays centered */
.categories.active .topic .cat-trigger {
    align-self: center !important;
}

/* Subcategory list */
.categories ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 8px 8px 8px !important;
    background: rgba(10, 10, 10, 0.5) !important;
}

.categories ul li {
    margin: 0 !important;
    padding: 0 !important;
}

.categories ul li a {
    display: block !important;
    padding: 16px 20px !important;
    color: #cccccc !important;
    text-decoration: none !important;
    font-size: 1.45rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.categories ul li a::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 3px !important;
    height: 100% !important;
    background: #892CFF !important;
    transform: scaleY(0) !important;
    transition: transform 0.3s ease !important;
}

.categories ul li a:hover {
    background: rgba(137, 44, 255, 0.1) !important;
    color: #ffffff !important;
    padding-left: 24px !important;
}

.categories ul li a:hover::before {
    transform: scaleY(1) !important;
}

/* Active/Selected subcategory page - WHITE TEXT ON PURPLE BACKGROUND */
.categories ul li.active > a,
.categories ul li a.active,
.categories ul li a[aria-current="page"] {
    background: linear-gradient(135deg, rgba(137, 44, 255, 0.3), rgba(137, 44, 255, 0.2)) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-left: 4px solid #892CFF !important;
    padding-left: 24px !important;
    box-shadow: 0 0 15px rgba(137, 44, 255, 0.3) !important;
}

.categories ul li.active > a::before,
.categories ul li a.active::before,
.categories ul li a[aria-current="page"]::before {
    transform: scaleY(1) !important;
}

/* External category (no subcategories) */
.categories.external .topic a {
    background: linear-gradient(135deg, rgba(137, 44, 255, 0.1), rgba(204, 6, 55, 0.1)) !important;
    border-left: 3px solid #892CFF !important;
}

.categories.external .topic a:hover {
    background: linear-gradient(135deg, rgba(137, 44, 255, 0.2), rgba(204, 6, 55, 0.2)) !important;
    border-left-color: #CC0637 !important;
}

/* Skip links styling */
.skip-link__wrapper {
    position: relative !important;
}

.skip-link {
    position: absolute !important;
    left: -9999px !important;
    background: #892CFF !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
}

.skip-link:focus {
    left: 0 !important;
    z-index: 999 !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .box-categories h4 {
        font-size: 2rem !important;
        padding: 20px !important;
    }
    
    #categories {
        gap: 0 !important;
    }
    
    .categories .topic a {
        padding: 18px 20px !important;
        font-size: 1.45rem !important;
    }
    
    .categories ul li a {
        padding: 14px 16px !important;
        font-size: 1.25rem !important;
    }
}

/* Animation for expanding/collapsing */
.categories ul {
    max-height: 0 !important;
    opacity: 0 !important;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease !important;
    overflow: hidden !important;
}

.categories.expanded ul {
    max-height: 2000px !important;
    opacity: 1 !important;
}

/* Add subtle shine animation on hover */
@keyframes category-shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.categories:hover .topic a {
    animation: category-shine 2s ease-in-out !important;
}
